package com.red.test;

import org.red.base.CanvasView;
import org.red.base.Scene;

import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;

public class BirdActivity extends Activity {

	private Scene scene = new Scene();
	BirdLayer birdLayer = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		CanvasView view = new CanvasView(getApplicationContext());
		setContentView(view);
		view.runWithScene(scene);
		
		birdLayer = new BirdLayer(getApplicationContext());
		scene.addChild(birdLayer);
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		switch(event.getAction()) {
		case MotionEvent.ACTION_DOWN:
			birdLayer.birdFly();
			break;
		}
		return super.onTouchEvent(event);
	}
	
}
